﻿@using brand.cyt369.com.MODELS
@{
    IQueryable<Carousel> carousels = ViewBag.carousels as IQueryable<Carousel>;
    IQueryable<Category> categorys = ViewBag.categorys as IQueryable<Category>;
    IQueryable<Brand> brandTop10 = ViewBag.brandTop10 as IQueryable<Brand>;
}

<div class="carousel-left">
    <ul>
        @if(categorys!=null){
            @foreach(var item in categorys){
                <li><a class='carousel-menu' href="~/Search/Index/@Base64.ObjectToBase64(new { page=1,parentCategoryID=item.ParentID })" target="_blank">@(item.CategoryName)类别</a></li>
            }
        }
    </ul>
</div>
<div class="carousel-center">
    <!-- 轮播图 -->
    <div class="carouselImageList-div">
        @if (carousels != null)
        {
            @foreach (var item in carousels.ToList())
            {
                <a href="~/Brand/Index/@Base64.ObjectToBase64(new { id=item.BrandID})" target="_blank">
                <img class="carouselImage" src="@string.Format("{0}/{1}",brand.cyt369.com.utility.SystemSettingService.Instance.BrandInternalBucket.HttpURL,item.ImagePath)" />
                </a>
            }
        }
    </div>
    <!-- 轮播小圆点 -->
    <div class="carouselDot-div">
        <!-- <span></span> -->
    </div>
    <!-- 轮播左右按钮 -->
    <div class="leftButton-div" onclick="CarouselLeftMove()"></div>
    <div class="rightButton-div" onclick="CarouselRightMove()"></div>
    <div class="detailTypeTotal-div">
        <!-- #region 子菜单 -->
            @if (categorys != null)
            {
                @foreach (var item in categorys)
                {
                <div class="detailType-div">
                    <h3>@item.CategoryName</h3>
                    <ul>
                        @if (item.Childs != null)
                        {
                            @foreach(var c in item.Childs)
                            {
                                <li><a href="~/Search/Index/@Base64.ObjectToBase64(new {  page=1,categoryID=c.Id })" target="_blank">@c.CategoryName</a></li>
                            }
                        }
                    </ul>
                </div>
                }
            }
        <!-- #endregion -->
    </div>
</div>
<div class="carousel-right">
    <div class="rank-div"><img src="~/image/index/排行榜.png"><span>品牌排行</span></div>
    <table class="carousel-right-table">
        @if (brandTop10 != null)
        {
            var list = brandTop10.ToList();
            @for (int i = 0; i < list.Count(); i++)
            {
                <tr>
                    <td>@(i+1)</td>
                    <td class="brandName"><a href="../Brand/Index/@Base64.ObjectToBase64(new { id = list[i].Id })" target="_blank">@list[i].Name</a></td>
                    <td>↑</td>
                    <td>@list[i].InquiryCount</td>
                </tr>
            }
        }
    </table>
</div>